package net.dgg.dggcloud.service.jrcrm.entity.orf;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;

import net.dgg.dggcloud.service.entity.BaseEntity;

import java.util.Date;

/**
 * @author 鲜林材
 * ${DESCRIPTION}:订单主表
 * @create 2017-11-03 11:04
 **/

@Entity
@Table(name = "orf_order")
public class Order extends BaseEntity {

    //数据库表名
    public static final String TABLE_NAME = "orf_order";

    @Column(name="amount")
    private Long amount = 0L;// 订单金额(单位分)  以收款金额

    /**
     *  合同金额
     */
    @Column(name="receivable_amount")
    private Long receivableAmount=0L;

    @Column(name="order_no")
    private String orderNo;//订单编号

    @Column(name="business_id")
    private Long businessId;//商机ID

    @Column(name="business_no")
    private String businessNo;//商机编号

    @Column(name="contact_phone")
    private String contactPhone;//客户联系人电话

    @Column(name="contact_phone_bak")
    private String contactPhoneBak;//客户联系人电话备份

    @Column(name="customer_name")
    private String customerName;//客户名称

    @Column(name="customer_id")
    private Long customerId;//客户ID

    /**
     *  内部成本
     */
    @Column(name="internal_cost")
    private Long internalCost = 0L;

    /**
     *  外部成本
     */
    @Column(name="external_cost")
    private Long externalCost = 0L;


    @Column(name="customer_no")
    private String customerNo;//客户编号

    @Column(name="pay_status")
    private String paySatus;//核款状态

    @Column(name="business_type_id")
    private String businessTypeId;//业态标识

    @Column(name="business_type_name")
    private String businessTypeName;//业态名称

    @Column(name="business_user_id")
    private Long businessUserId;//签单商务

    @Column(name="status")
    private String status;//订单状态

    @Column(name="organization_id")
    private Long organizationId;//部门ID

    @Column(name="organization_name")
    private String organizationName;//部门名称

    @Column(name="achievement")
    private Long achievement = 0L;//业绩


    @Column(name="profit")
    private Long profit = 0L;//利润

    @Column(name="sign_org_id")
    private Long signOrgId;//签单事业部id

    @Column(name="sign_org_name")
    private String signOrgName;//签单事业部名称

    @Column(name="loans_amount")
    private Long loansAmount=0L;//贷款金额(单位分)

    @Column(name="loans_num")
    private String loansNum;//贷款年限

    @Column(name = "loans_interest")
    private String loansInterest;//贷款利息

    @Column(name = "earnest_money")
    private  Long earnestMoney=0L;//定金(单位分)

    @Column(name = "loans_rate_type")
    private  String loansRateType;//贷款利息方式

    @Column(name = "mortgage_address")
    private String mortgageAddress;//抵押物地址

    @Column(name = "place_order_time")
    private Date placeOrderTime;//下单时间

    @Column(name = "back_order_time")
    private Date backOrderTime;//退单时间

    @Column(name = "back_order_reason")
    private String backOrderReason;//退单原因

    @Column(name="audit_user_id")
    private Long auditUserId;//审核人id

    @Column(name="audit_order_time")
    private Date auditOrderTime;//审核时间

    @Column(name="audit_reject_reason")
    private String auditRejectReason;//不通过原因

    @Column(name="payment_method")
    private String paymentMethod = "ORF_FKFS_1";//付款方式

    @Column(name="transfer_user_id")
    private Long transferUserId;//移交人id


    public String getContactPhoneBak() {
        return contactPhoneBak;
    }

    public void setContactPhoneBak(String contactPhoneBak) {
        this.contactPhoneBak = contactPhoneBak;
    }

    public String getPaymentMethod() {
        return paymentMethod;
    }

    public void setPaymentMethod(String paymentMethod) {
        this.paymentMethod = paymentMethod;
    }

    public String getAuditRejectReason() {
        return auditRejectReason;
    }

    public void setAuditRejectReason(String auditRejectReason) {
        this.auditRejectReason = auditRejectReason;
    }

    public Date getAuditOrderTime() {
        return auditOrderTime;
    }

    public void setAuditOrderTime(Date auditOrderTime) {
        this.auditOrderTime = auditOrderTime;
    }

    public Long getAuditUserId() {
        return auditUserId;
    }

    public void setAuditUserId(Long auditUserId) {
        this.auditUserId = auditUserId;
    }

    public static String getTableName() {
        return TABLE_NAME;
    }

    public Date getBackOrderTime() {
        return backOrderTime;
    }

    public void setBackOrderTime(Date backOrderTime) {
        this.backOrderTime = backOrderTime;
    }

    public String getBackOrderReason() {
        return backOrderReason;
    }

    public void setBackOrderReason(String backOrderReason) {
        this.backOrderReason = backOrderReason;
    }

    public String getLoansInterest() {
        return loansInterest;
    }

    public void setLoansInterest(String loansInterest) {
        this.loansInterest = loansInterest;
    }

    public Long getAmount() {
        return amount;
    }

    public void setAmount(Long amount) {
        this.amount = amount;
    }

    public String getOrderNo() {
        return orderNo;
    }

    public void setOrderNo(String orderNo) {
        this.orderNo = orderNo;
    }

    public Long getBusinessId() {
        return businessId;
    }

    public void setBusinessId(Long businessId) {
        this.businessId = businessId;
    }

    public String getBusinessNo() {
        return businessNo;
    }

    public void setBusinessNo(String businessNo) {
        this.businessNo = businessNo;
    }

    public String getContactPhone() {
        return contactPhone;
    }

    public void setContactPhone(String contactPhone) {
        this.contactPhone = contactPhone;
    }

    public String getCustomerName() {
        return customerName;
    }

    public void setCustomerName(String customerName) {
        this.customerName = customerName;
    }

    public Long getCustomerId() {
        return customerId;
    }

    public void setCustomerId(Long customerId) {
        this.customerId = customerId;
    }

    public String getCustomerNo() {
        return customerNo;
    }

    public void setCustomerNo(String customerNo) {
        this.customerNo = customerNo;
    }

    public String getPaySatus() {
        return paySatus;
    }

    public void setPaySatus(String paySatus) {
        this.paySatus = paySatus;
    }

    public String getBusinessTypeId() {
        return businessTypeId;
    }

    public void setBusinessTypeId(String businessTypeId) {
        this.businessTypeId = businessTypeId;
    }

    public String getBusinessTypeName() {
        return businessTypeName;
    }

    public void setBusinessTypeName(String businessTypeName) {
        this.businessTypeName = businessTypeName;
    }

    public Long getBusinessUserId() {
        return businessUserId;
    }

    public void setBusinessUserId(Long businessUserId) {
        this.businessUserId = businessUserId;
    }

    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    public Long getOrganizationId() {
        return organizationId;
    }

    public void setOrganizationId(Long organizationId) {
        this.organizationId = organizationId;
    }

    public String getOrganizationName() {
        return organizationName;
    }

    public void setOrganizationName(String organizationName) {
        this.organizationName = organizationName;
    }

    public Long getAchievement() {
        return achievement;
    }

    public void setAchievement(Long achievement) {
        this.achievement = achievement;
    }

    public Long getProfit() {
        return profit;
    }

    public void setProfit(Long profit) {
        this.profit = profit;
    }

    public Long getSignOrgId() {
        return signOrgId;
    }

    public void setSignOrgId(Long signOrgId) {
        this.signOrgId = signOrgId;
    }

    public String getSignOrgName() {
        return signOrgName;
    }

    public void setSignOrgName(String signOrgName) {
        this.signOrgName = signOrgName;
    }

    public Long getLoansAmount() {
        return loansAmount;
    }

    public void setLoansAmount(Long loansAmount) {
        if(loansAmount==null){
            this.loansAmount = 0L;
        }else{
            this.loansAmount = loansAmount;
        }
    }

    public String getLoansNum() {
        return loansNum;
    }

    public void setLoansNum(String loansNum) {
        this.loansNum = loansNum;
    }

    public String getLoansRateType() {
        return loansRateType;
    }

    public void setLoansRateType(String loansRateType) {
        this.loansRateType = loansRateType;
    }

    public Long getEarnestMoney() {
        return earnestMoney;
    }

    public void setEarnestMoney(Long earnestMoney) {
        if(earnestMoney==null){
            this.earnestMoney = 0L;
        }else{
            this.earnestMoney = earnestMoney;
        }
    }

    public String getMortgageAddress() {
        return mortgageAddress;
    }

    public void setMortgageAddress(String mortgageAddress) {
        this.mortgageAddress = mortgageAddress;
    }

    public Date getPlaceOrderTime() {
        return placeOrderTime;
    }

    public void setPlaceOrderTime(Date placeOrderTime) {
        this.placeOrderTime = placeOrderTime;
    }

    public Long getInternalCost() {
        return internalCost;
    }

    public void setInternalCost(Long internalCost) {
        this.internalCost = internalCost;
    }

    public Long getExternalCost() {
        return externalCost;
    }

    public void setExternalCost(Long externalCost) {
        this.externalCost = externalCost;
    }

    public Long getReceivableAmount() {
        return receivableAmount;
    }

    public void setReceivableAmount(Long receivableAmount) {
        this.receivableAmount = receivableAmount;
    }

    public Long getTransferUserId() {
        return transferUserId;
    }

    public void setTransferUserId(Long transferUserId) {
        this.transferUserId = transferUserId;
    }
}
